﻿using System;
using Spring.Context;
using Spring.Context.Support;

namespace Mayfair.Core.Common.DI
{
    public class Spring : AbstractDIContainer
    {
        private IApplicationContext context;

        public Spring()
        {
            this.context = ContextRegistry.GetContext();
        }

        public override T GetObject<T>(Object key)
        {
            return (T)context.GetObject((string)key);
        }
    }

    public class Hoge
    {
        public Hoge() { }

        public string GetMessage()
        {
            return "You Get Hoge";
        }
    }
}
